#ifndef TC_CONFIG_SUN_H
#define TC_CONFIG_SUN_H

/** \file ConfigSun.h 
 * Configuration items for Sun platform
 *
 * (C) Copyright Semih Cemiloglu
 * All rights reserved, see COPYRIGHT file for details.
 *
 * $Id: ConfigSun.h 111 2006-06-19 03:45:40Z semihc $
 *
 *
 */


/* Make sure we are on SunOS */
#ifndef TC_PLAT_Sun
# error This file should be included only on SunOS
#endif

/* Determine arhitecture */
#if defined(__sparc)
#  define TC_ARCH __sparc
#  define TC_ARCH_sparc 1
#elif defined(__sparcv9)
#  define TC_ARCH __sparcv9
#  define TC_ARCH_sparcv9 1
#elif defined(__i386)
#  define TC_ARCH __i386
#  define TC_ARCH_i386 1
#elif defined(__amd64)
#  define TC_ARCH __amd64
#  define TC_ARCH_amd64 1
#else
#  error Unknown SunOS architecture
#endif

/* Determine compiler */
#if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
#  define TC_COMP Sunpro
#  define TC_COMP_Sunpro 1
#elif defined(__GNUC__)
#  define TC_COMP Gcc
#  define TC_COMP_Gcc 1
#else
#  error Unknown C/C++ compiler on SunOS
#endif


/* Ident macro: _Pragma(ident(ID)) doesn't work */

#define TC_IDENT(ID)


#define TC_NO_PTHREAD_YIELD
#if defined(__sparc) || defined(__sparcv9)
# define TC_BIGENDIAN
#endif

#ifdef TC_COMP_Sunpro
/* Second form requires -features=extensions flag at compile time
   define TC_FUNCTION __FILE__ TC_MACRO2STRING(__LINE__)
*/
#  define TC_FUNCTION __func__
#  define TC_THREAD_LOCAL __thread
#  define TC_NO_CHECKEDITERATOR
#  define TC_LIMITED_TYPEREF
#  define TC_REPLACE_STD_ALLOCATOR
#  define TC_USE_FASTTIME
#  define TC_TEMPLATE_DEFS_SEPARATE
#  if __SUNPRO_C >= 0x580
#   define TC_STDINT_H_EXISTS
#  endif
#  if __SUNPRO_CC >= 0x580
#   define TC_STDINT_H_EXISTS
#  endif
#  if __SUNPRO_CC >= 0x560
    /* For FlexString: */
#   define TC_NO_ITERATOR_TRAITS
#  endif
#endif

#ifdef TC_COMP_Gcc
#  define TC_USE_LONG_LONG 0
#  define TC_FUNCTION __PRETTY_FUNCTION__
#  define TC_THREAD_LOCAL __thread
   /* For CheckIterator: */
#  define TC_NO_ITERATORTRAITS_TYPES
#  define TC_NO_ASCTIME_R
#endif


#endif /* TC_CONFIG_SUN_H */
